<template>
	<view class="logon">
		<view class="status-bar"></view>
		<view class="box">
		<image src="../../bc/phone.png" mode=""><input type="text" v-model="id" :placeholder="$t('idSafe.forgetDealP.inpTel')">
		<!-- 验证码 -->
		<view class="box2">
		<input type="text" v-model="yz" :placeholder="$t('idSafe.forgetDealP.inpCode')">
			<button type="default" @click="getyz">{{msg}}</button>
		</view>
		<image src="../../static/teamLeaderResult/peoples.png" mode="" class="world"><input type="text" v-model="peoples" :placeholder="$t('mine.teamLeader.number')">
		<image src="../../static/teamLeaderResult/address.png" mode=""><input type="text" v-model="address" :placeholder="$t('mine.teamLeader.address')">
		
		<button @click="go" class="registry">{{$t('mine.teamLeader.submit')}}</button>
		<!-- 用户协议 -->
		<label >
			<checkbox :checked="checks" /><text class="tongy">{{$t('mine.teamLeader.agreement')}}<text class="xy">《众赢用户协议》</text></text>
		</label>
		</view>
	</view>
</template>


<script>
	export default{
		name:'logon',
		data(){
			return{
				nick:'', // 用户昵称
				id:'', // 用户手机号
				yz:'', // 验证码
				peoples:'', // 密码
				address:'', // 确认密码
				msg:this.$t('idSafe.forgetDealP.getCode'),
				checks:true
			}
		},
		methods:{
			// 注册
			go(){
				let {nick,id,yz,peoples,address}=this;
				var reg= /^1[3-9]\d{9}$/;
				  var regs=/^[a-zA-Z0-9]{6,18}$/;
				// 输入框不为空
				// if(nick && id && yz && peoples && address){
				// 	// 账号格式不对
				// 	  if(!reg.test(id)){
				// 	  uni.showToast({
				// 	  	title:'手机号格式不正确',
				// 		icon:'none'
				// 	  })
				// 	    return;
				// 	  }else{
						// 跳转
				// 		console.log(22);
				// 		}
						
				// }else{
				// 	uni.showToast({
				// 		title:'请补充完整信息',
				// 		icon:'none'
				// 	})
				// }
				
				// 申请结果页面
				uni.navigateTo({
					url:'../../pages/teamLeaderResults/teamLeaderResults'
				})
				
			},
			// 获取验证码
			getyz(){
				console.log(11);
				// 发送请求
				var time=60;
				var setIn=setInterval(res =>{
					this.msg=time-- +' 后重新发送';
					if(time<0){
						this.msg='获取验证码';
						clearInterval(setIn)
						}
				},1000)
				
				
			}
		}
	}
</script>

<style scoped>
	.logon{
		position: relative;
	}
	
	
	input{
		width: 80%;
		height: 100rpx;
		opacity: .6;
		padding-left: 80rpx;
		font-size: 1em;
		margin: 0 auto 40rpx;
		border-bottom: solid 2rpx #F6F6F6;
	}
	image{
		width: 40rpx;
		height: 40rpx;
		position: absolute;
		left: 50rpx;
		margin-top: 30rpx;
	}
	.world{
		margin-top: 30rpx;
	}
	.box2{
		display: flex;
		
		}
		.box2>input{
			width: 45%;
			margin-left: 60rpx;
			border-bottom: solid 2rpx #F6F6F6;
		}
		.box2>button{
			width: 30%;
			height: 60rpx;
			line-height: 60rpx;
			margin-top: 40rpx;
			font-size: .8em;
		/* 	background: -moz-linear-gradient(left, #000000 0%, #ffffff 100%);
			    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#000000), color-stop(100%,#ffffff));
			    background: -webkit-linear-gradient(left, #000000 0%,#ffffff 100%); */
			   /* background: -o-linear-gradient(top, #000000 0%,#ffffff 100%);
			    background: -ms-linear-gradient(top, #000000 0%,#ffffff 100%); */
			    background: linear-gradient(to right, #3D54EA 50%,#7593FF 100%);
		}
	.registry{
		width: 90%;
		background-color: #207DFE;
		border-radius: 50rpx;
		margin: 120rpx auto;
		color: #FFFFFF;
	}
	label{
		position: relative;
		left: 30rpx;
		top: -80rpx;
	}
	uni-checkbox-input{
		border: 2rpx solid #207DFE;
	}
	/* 同意 */
	.tongy{
		color: #C4C4C4;
	}
	/* 协议 */
	.xy{
		color: #556EFF;
		margin-left: 20rpx;
	}
</style>

